


#ifndef PF_VARIABLEDICT_H
#define PF_VARIABLEDICT_H

#include <QHash>
#include "pf_variable.h"
#include "lx_Export.h"

class PF_Vector;

/**
 * Dictionary of variables. The variables are stored as key / value
 * pairs (string / string).
 *

 */
class LX_EXPORT PF_VariableDict {
public:
    PF_VariableDict();
    virtual ~PF_VariableDict() {}

    void clear();
    /**
     * @return Number of variables available.
     */
    int count() {
        return variables.count();
    }

    void add(const QString& key, const PF_Vector& value, int code);
    void add(const QString& key, const QString& value, int code);
    void add(const QString& key, int value, int code);
    void add(const QString& key, double value, int code);

    PF_Vector getVector(const QString& key, const PF_Vector& def);
    QString getString(const QString& key, const QString& def);
    int getInt(const QString& key, int def);
    double getDouble(const QString& key, double def);

    virtual void remove(const QString& key);

        QHash<QString, PF_Variable>& getVariableDict() {
		return variables;
	}

    //void addVariableDictListener(PF_VariableDictListener* listener);

    friend std::ostream& operator << (std::ostream& os, PF_VariableDict& v);

private:
    //! Variables for the graphic
    QHash<QString, PF_Variable> variables;
}
;

#endif
